<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{   
    protected $table = 'articles';
    //
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'title',
        'description',
        'content',
        'cover',
        'status',
        'sort',
        'type',
        'ishome',
        'popup'
    ];

    public function statusinfo(){
        $info = ['未发布','已发布'];
        return $info[$this->status];
    }

    public function ishome(){
        $info = ['否','是'];
        return $info[$this->ishome];
    }

    public function popup(){
        $info = ['否','是'];
        return $info[$this->popup];
    }
}
